import { get, post } from "@/utils/http";
import type { RowType } from "@/types/chargingstation/index";
const Api = {
  List: "/stationList",
  Edit: "/station/edit",
  Delete: "/station/delete",
  RevenueChart:  "/revenueChart",
  Renvenue:'/revenueList',
  CurrentList: "/currentList",
};

interface listType {
  name?: string;
  id?: string;
  status: number;
  page: number;
  pageSize: number;  
}

interface RenvenueType {
 page:number,
 pageSize:number,
 name:string,
}

function listApi(data: listType) {
  return post(Api.List, data);
}

function editApi(data: RowType) {
  return post(Api.Edit, data);
}

function deleteApi(id: string) {
  return post(Api.Delete, {id});
}

function chartApi() {
  return get(Api.RevenueChart);
}

function revenueApi(data: RenvenueType) {
  return post(Api.Renvenue,data);
}

function currentListApi() {
  return get(Api.CurrentList);
}

export { listApi, editApi ,deleteApi,chartApi,revenueApi,currentListApi};
